//
//  UIView+Extension.swift
//  WeiBo
//
//  Created by Feng on 2017/6/4.
//  Copyright © 2017年 feng. All rights reserved.
//

import UIKit

extension UIView
{
    //x坐标
    var x: CGFloat
    {
        get{
            return self.frame.origin.x
        }set{
            self.frame.origin.x = newValue
        }
    }
    
    //y坐标
    var y: CGFloat
    {
        get{
            return self.frame.origin.y
        }set{
            self.frame.origin.y = newValue
        }
    }
    
    //width
    var width: CGFloat
    {
        get{
            return self.frame.size.width
        }set{
            self.frame.size.width = newValue
        }
    }
    
    //height
    var height: CGFloat
    {
        get{
            return self.frame.size.height
        }set{
            self.frame.size.height = newValue
        }
    }
    
    //size
    var size: CGSize
    {
        get{
            return self.frame.size
        }set{
            self.frame.size = newValue
        }
    }
    
    //centerX
    var centerX: CGFloat
    {
        get{
            return self.center.x
        }set{
            self.center.x = newValue
        }
    }

    //centerY
    var centerY: CGFloat
    {
        get{
            return self.center.y
        }set{
            self.center.y = newValue
        }
    }
}
